package com.bootx.entity;

import com.bootx.common.BaseAttributeConverter;
import jakarta.persistence.Column;
import jakarta.persistence.Convert;
import jakarta.persistence.Converter;
import jakarta.persistence.Entity;

import java.util.ArrayList;
import java.util.List;

/**
 * @author black
 */
@Entity
public class Image extends BaseEntity<Long>{

    @Convert(converter = UrlConverter.class)
    @Column(columnDefinition = "varchar(8000)")
    private List<String> urls = new ArrayList<>();

    private Integer status;

    @Column(nullable = false,updatable = false,unique = true)
    private String sn;

    public List<String> getUrls() {
        return urls;
    }

    public void setUrls(List<String> urls) {
        this.urls = urls;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getSn() {
        return sn;
    }

    public void setSn(String sn) {
        this.sn = sn;
    }

    @Converter
    public static class UrlConverter extends BaseAttributeConverter<List<String>> {}
}
